<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:th="http://www.thymeleaf.org">
<head>
<title>首页</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head>
<body>
	<div class="container" id="content">
		<section class="content-header">
			<h1>
				<i class="fa fa-file"></i> <strong>备件合同管理</strong>
			</h1>
			<ol class="breadcrumb">
				<li><a href="#"><i class="fa fa-home "></i>Home</a></li>
				<li>合同管理</li>
				<li class="active">备件合同管理</li>
			</ol>
		</section>
		<!-- Main content -->
		<section class="content">
			<div class="box box-info">
				<div class="box-header with-border">
					<i class="fa fa-th-list"></i>
					<h4 class="box-title">备件合同信息</h4>
					<button type="button" class="btn btn-info" id="importQuote">引入报价单</button>
				</div>
				<div class="row-fluid">
					<div class="span12">
						<div id="container" class="widget-title">
							<ul class="nav nav-tabs" id="myTabs">
								<li><a data-toggle="tab" href="#tab1"><span>合同信息</span></a></li>
								<li><a data-toggle="tab" href="#tab2"><span>细 目</span></a></li>
							</ul>
						</div>
						<div class="pre-scrollable1">
							<div class="widget-content tab-content">

								<div id="tab1" class="active tab-pane">
									<form id="contractAtrrForm" class="widget-box">
										<input class="form-control" type="hidden" id="contractId"
											name="contractId" /> <input class="form-control"
											type="hidden" id="createTime" name="createTime" /> <input
											class="form-control" type="hidden" id="userId" name="userId"
											th:value="${userId}" /> <input class="form-control"
											type="hidden" id="state" name="state" value="正常" /> <input
											class="form-control" type="hidden" id="cstate" name="cstate"
											value="未排产" />
										<div class="widget-content nopadding">
											<table class="table table-bordered">
												<tbody>
													<tr class="odd gradeX">
														<td width="8%" align="center"
															style="vertical-align: middle">供方合同号</td>
														<td width="17%">
															<div class="col-md-11">
																<input class="form-control" type="text"
																	id="supplierCode" name="supplierCode"
																	datatype="*,*1-100,t" nullmsg="请输入供方合同号" />
															</div>
															<div class="col-md-1">
																<span style="color: #F00">*</span>
															</div>
														</td>
														<td width="8%" align="center"
															style="vertical-align: middle">需方合同号</td>
														<td width="17%">
															<div class="col-md-11">
																<input class="form-control" type="text"
																	id="demanderCode" name="demanderCode" />
															</div>
														</td>
														<td width="8%" align="center"
															style="vertical-align: middle">总价(元)</td>
														<td width="17%">
															<div class="col-md-11">
																<input class="form-control" type="text" id="totalSum"
																	name="totalSum" onkeyup="clearNoNum(this)"
																	datatype="*,n" nullmsg="请输入合同总价" errormsg="请填写数字" />
															</div>
															<div class="col-md-1">
																<button type="button" class="btn btn-info" id="adjustment">调整</button>
															</div>
														</td>
													</tr>
													<tr>
														<td width="8%" align="center"
															style="vertical-align: middle">签订日期</td>
														<td width="17%">
															<div class="col-md-11">
																<input class="form-control" type="date" id="signedDate"
																	name="signedDate" datatype="*,*1-100,t"
																	nullmsg="请输入签订日期" />
															</div>
															<div class="col-md-1">
																<span style="color: #F00">*</span>
															</div>
														</td>
														<td width="8%" align="center"
															style="vertical-align: middle">排产日期</td>
														<td width="17%">
															<div class="col-md-11">
																<input class="form-control" type="date"
																	id="scheduleDate" name="scheduleDate" />
															</div>
														</td>
														<td width="8%" align="center"
															style="vertical-align: middle">交货日期</td>
														<td width="17%">
															<div class="col-md-11">
																<input class="form-control" type="date" id="giveOutDate"
																	name="giveOutDate" datatype="*,*1-100,t"
																	nullmsg="请输入交货日期" />
															</div>
															<div class="col-md-1">
																<span style="color: #F00">*</span>
															</div>
														</td>
													</tr>
													<tr>
														<td width="8%" align="center"
															style="vertical-align: middle">项目编号</td>
														<td width="17%">
															<div class="col-md-11">
																<input class="form-control" type="text" id="projectCode"
																	name="projectCode" />
															</div>
															<div class="col-md-1">
																<span style="color: #F00"></span>
															</div>
														</td>
														<td width="8%" align="center"
															style="vertical-align: middle">货物到站</td>
														<td width="17%">
															<div class="col-md-11">
																<input class="form-control" type="text" id="stop"
																	name="stop" datatype="t" />
															</div>
															<div class="col-md-1">
																<span style="color: #F00"></span>
															</div>
														</td>
														<td width="8%" align="center"
															style="vertical-align: middle">运费支付(元)</td>
														<td width="17%">
															<div class="col-md-11">
																<input class="form-control" type="text"
																	id="freightCharge" name="freightCharge"
																	onkeyup="clearNoNum(this)" datatype="n"
																	errormsg="请填写数字" />
															</div>
															<div class="col-md-1">
																<span style="color: #F00"></span>
															</div>
														</td>
													</tr>
													<tr>
														<td width="8%" align="center"
															style="vertical-align: middle">项目名称</td>
														<td colspan="3">
															<div class="col-md-11">
																<input class="form-control" type="text" id="projectName"
																	name="projectName" datatype="*,*1-100,t"
																	nullmsg="请输入项目名称" />
															</div>
															<div class="col-md-1">
																<span style="color: #F00">*</span>
															</div>
														</td>
														<td></td>
														<td></td>
													</tr>
													<tr>
														<td width="8%" align="center"
															style="vertical-align: middle">付款方式</td>
														<td colspan="7">
															<div class="col-md-11">
																<textarea class="form-control" style="width: 100%"
																	id="payType" name="payType" rows="3"
																	datatype="*,*1-1000" nullmsg="请输入付款方式"></textarea>
															</div>
															<div class="col-md-1">
																<span style="color: #F00">*</span>
															</div>
														</td>
													</tr>
													<tr>
														<td width="8%" align="center"
															style="vertical-align: middle">质保期限</td>
														<td colspan="7">
															<div class="col-md-11">
																<textarea class="form-control" style="width: 100%"
																	id="guaranteePeriod" name="guaranteePeriod" rows="2"
																	></textarea>
															</div>
														</td>
													</tr>
													<tr>
														<td width="8%" align="center"
															style="vertical-align: middle">违约责任</td>
														<td colspan="7">
															<div class="col-md-11">
																<textarea class="form-control" style="width: 100%"
																	id="breakDuty" name="breakDuty" rows="2"
																	 ></textarea>
															</div>
														</td>
													</tr>
												</tbody>
											</table>
										</div>

										<table class="table table-bordered">
											<tbody>
												<tr class="odd gradeX">
													<td width="10.5%" align="center"
														style="vertical-align: middle">合同类型</td>
													<td width="23%">
														<div class="col-md-11">
															<input class="form-control" type="text" id="contractType"
																name="contractType" value="备件合同" readonly="readonly" />
														</div>
														<div class="col-md-1">
															<span style="color: #F00"></span>
														</div>
													</td>
													<td colspan="4"></td>
												</tr>
											</tbody>
										</table>

										<div class="form-inline">
											<div class="form-group">
												<h4>
													<strong>已关联合同</strong>
												</h4>
											</div>
										</div>
										<table width="100%"
											class="mytable dataTable table-bordered text-center table-striped table-hover"
											id="resultRelevanceTable">
											<thead>
												<tr>
													<th class="center" width="10%">序号</th>
													<th class="center" width="35%">合同号</th>
													<th class="center" width="35%">项目名称</th>
													<th class="center" width="20%">签订时间</th>
												</tr>
											</thead>
											<tbody>
											</tbody>
										</table>

										<div>
											<h4>
												<strong>订货单位信息</strong>
												<button type="button" class="btn btn-info"
													id="queryCustomerPayInfo">切换开票信息</button>
												<button type="button" class="btn btn-info" id="saveCustomer">新增客户</button>
											</h4>
										</div>
										<table class="table table-bordered">
											<tbody>
												<tr class="odd gradeX">
													<td width="8%" align="center"
														style="vertical-align: middle">订货单位</td>
													<td width="17%">
														<div class="col-sd-4 input-group"
															style="margin-left: 8px;">
															<input type="hidden" name="customerId" id="customerId" />
															<input class="form-control" type="text"
																readonly="readonly" id="orderUnit" name="orderUnit"
																datatype="*,*1-100,t" nullmsg="请输入订货单位" /> <span
																class="input-group-btn">
																<button type="button" id="queryCustomer"
																	class="btn btn-info" title="引入订货单位信息">
																	<i class="fa fa-search"></i>
																</button>
															</span>
														</div>
													</td>
													<td width="8%" align="center"
														style="vertical-align: middle">订货代表</td>
													<td width="17%">
														<div class="col-md-11">
															<input class="form-control" type="text"
																id="orderDelegate" name="orderDelegate" />
														</div>
														<div class="col-md-1">
															<span style="color: #F00"></span>
														</div>
													</td>
													<td width="8%" align="center"
														style="vertical-align: middle">订货电话</td>
													<td width="17%">
														<div class="col-md-11">
															<input class="form-control" type="text" id="orderPhone"
																name="orderPhone" />
														</div>
														<div class="col-md-1">
															<span style="color: #F00"></span>
														</div>
													</td>
												</tr>
												<tr class="odd gradeX">
													<td width="8%" align="center"
														style="vertical-align: middle">订货邮编</td>
													<td width="17%">
														<div class="col-md-11">
															<input class="form-control" type="text" id="orderZip"
																name="orderZip" 
																 /><!-- onkeyup="clearNoInteger(this)" dataType="p" -->
														</div>
														<div class="col-md-1">
															<span style="color: #F00"></span>
														</div>
													</td>
													<td width="8%" align="center"
														style="vertical-align: middle">订货片区</td>
													<td width="17%">
														<div class="col-md-11">
															<select class="form-control" id="orderArea"
																name="orderArea" datatype="*,*1-100,t" nullmsg="请选择订货片区">
																<option></option>
																<option th:each="orderArea:${orderAreas}"
																	th:text="${orderArea}"></option>
															</select>
														</div>
														<div class="col-md-1">
															<span style="color: #F00">*</span>
														</div>
													</td>
													<td width="8%" align="center"
														style="vertical-align: middle">行业信息</td>
													<td width="17%">
														<div class="col-md-11">
															<select class="form-control" id="industryInfo"
																name="industryInfo" datatype="*,*1-100,t"
																nullmsg="请选择行业信息">
																<option></option>
																<option th:each="industryInfo:${industryInfos}"
																	th:text="${industryInfo.title}"></option>
															</select>
														</div>
														<div class="col-md-1">
															<span style="color: #F00">*</span>
														</div>
													</td>
												</tr>
												<tr class="odd gradeX">
													<td width="8%" align="center"
														style="vertical-align: middle">开票银行</td>
													<td width="17%">
														<div class="col-md-11">
															<input class="form-control" type="text" id="invoiceBank"
																name="invoiceBank" />
														</div>
														<div class="col-md-1">
															<span style="color: #F00"></span>
														</div>
													</td>
													<td width="8%" align="center"
														style="vertical-align: middle">银行账号</td>
													<td width="17%">
														<div class="col-md-11">
															<input class="form-control" type="text" id="bankAccount"
																name="bankAccount" />
														</div>
														<div class="col-md-1">
															<span style="color: #F00"></span>
														</div>
													</td>
													<td width="8%" align="center"
														style="vertical-align: middle">税 号</td>
													<td width="17%">
														<div class="col-md-11">
															<input class="form-control" type="text" id="taxNumber"
																name="taxNumber" />
														</div>
														<div class="col-md-1">
															<span style="color: #F00"></span>
														</div>
													</td>
												</tr>
												<tr class="odd gradeX">
													<td width="8%" align="center"
														style="vertical-align: middle">订货地址</td>
													<td colspan="3">
														<div class="col-md-11">
															<input class="form-control" type="text" id="orderAddress"
																name="orderAddress" />
														</div>
														<div class="col-md-1">
															<span style="color: #F00"></span>
														</div>
													</td>
													<td width="8%" align="center"
														style="vertical-align: middle">开票地址</td>
													<td width="17%">
														<div class="col-md-11">
															<input class="form-control" type="text"
																id="invoiceAddress" name="invoiceAddress" />
														</div>
														<div class="col-md-1">
															<span style="color: #F00"></span>
														</div>
													</td>
												</tr>
											</tbody>
										</table>

										<div>
											<h4>
												<strong>邮寄单位信息</strong>
												<button type="button" class="btn btn-info"
													id="changeUnitAdressBtn">切换邮寄单位地址</button>
											</h4>
										</div>
										<table class="table table-bordered">
											<tbody>
												<tr class="odd gradeX">
													<td width="8%" align="center"
														style="vertical-align: middle">邮寄单位</td>
													<td width="17%">
														<div class="col-md-11">
															<input class="form-control" type="text" id="postUnit"
																name="postUnit" />
														</div>
														<div class="col-md-1">
															<span style="color: #F00"></span>
														</div>
													</td>
													<td width="8%" align="center"
														style="vertical-align: middle">邮寄代表</td>
													<td width="17%">
														<div class="col-md-11">
															<input class="form-control" type="text" id="postDelegate"
																name="postDelegate" />
														</div>
														<div class="col-md-1">
															<span style="color: #F00"></span>
														</div>
													</td>
													<td width="8%" align="center"
														style="vertical-align: middle">邮寄电话</td>
													<td width="17%">
														<div class="col-md-11">
															<input class="form-control" type="text" id="postPhone"
																name="postPhone" />
														</div>
														<div class="col-md-1">
															<span style="color: #F00"></span>
														</div>
													</td>
												</tr>
												<tr class="odd gradeX">
													<td width="8%" align="center"
														style="vertical-align: middle">邮寄地址</td>
													<td colspan="3">
														<div class="col-md-11">
															<input class="form-control" type="text" id="postAddress"
																name="postAddress" />
														</div>
														<div class="col-md-1">
															<span style="color: #F00"></span>
														</div>
													</td>
													<td width="8%" align="center"
														style="vertical-align: middle">邮寄邮编</td>
													<td width="17%">
														<div class="col-md-11">
															<input class="form-control" type="text" id="postZip"
																name="postZip" 
																/><!-- onkeyup="clearNoInteger(this)" dataType="p"  -->
														</div>
														<div class="col-md-1">
															<span style="color: #F00"></span>
														</div>
													</td>
												</tr>
											</tbody>
										</table>

										<div>
											<h4>
												<strong>合同分类明细</strong>
											</h4>
										</div>
										<table class="table table-bordered">
											<tbody>
												<tr class="odd gradeX">
													<td width="8%" align="center"
														style="vertical-align: middle">责任区域</td>
													<td width="17%">
														<div class="col-md-11">
															<select class="form-control" id="dutyArea"
																name="dutyArea" style="width: 100%">
																<option></option>
																<option th:each="orderArea:${orderAreas}"
																	th:text="${orderArea}"></option>
															</select>
														</div>

													</td>
													<td width="8%" align="center"
														style="vertical-align: middle">责任人</td>
													<td width="17%">
														<div class="col-md-11">
															<select class="form-control" id="dutyOfficer"
																name="dutyOfficer" style="width: 100%">
																<option></option>
																<option th:each="user:${allSuperiorMen}"
																	th:text="${user.empLogin.name}"></option>
															</select>
														</div>

													</td>
													<td width="8%" align="center"
														style="vertical-align: middle">南北片区</td>
													<td width="17%">
														<div class="col-md-11">
															<select class="form-control" id="southNorthArea"
																name="southNorthArea">
																<option></option>
																<option th:each="southNorthArea:${southNorthAreas}"
																	th:text="${southNorthArea.title}"></option>
															</select>
														</div>

													</td>
												</tr>
												<tr class="odd gradeX">
													<td width="8%" align="center"
														style="vertical-align: middle">所属板块</td>
													<td width="17%">
														<div class="col-md-11">
															<input class="form-control" id="belongArea"
																name="belongArea" readonly="readonly" />
														</div>

													</td>
													<td width="8%" align="center"
														style="vertical-align: middle">考核分类</td>
													<td width="17%">
														<div class="col-md-11">
															<select class="form-control" id="checkKind"
																name="checkKind">
																<option></option>
																<option th:each="checkKind:${checkKinds}"
																	th:text="${checkKind.title}"></option>
															</select>
														</div>

													</td>
													<td width="8%" align="center"
														style="vertical-align: middle">产品分类</td>
													<td width="17%">
														<div class="col-md-11">
															<select class="form-control" id="productKind"
																name="productKind">
																<option></option>
																<option th:each="productKind:${productKinds}"
																	th:text="${productKind.title}"></option>
															</select>
														</div>

													</td>
												</tr>
												<tr class="odd gradeX">
													<td width="8%" align="center"
														style="vertical-align: middle">合同签订人</td>
													<td width="17%">
														<div class="col-md-11">
															<select class="form-control" id="signOfficer"
																name="signOfficer" style="width: 100%">
																<option></option>
																<option th:each="user:${allSuperiorMen}"
																	th:text="${user.empLogin.name}"></option>
															</select>
														</div>

													</td>
													<td width="8%" align="center"
														style="vertical-align: middle">维修协议人</td>
													<td width="17%">
														<div class="col-md-11">
															<select class="form-control" id="repairOfficer"
																name="repairOfficer" style="width: 100%">
																<option></option>
																<option th:each="user:${allSuperiorMen}"
																	th:text="${user.empLogin.name}"></option>
															</select>
														</div>

													</td>
													<td width="8%" align="center"
														style="vertical-align: middle">报价人</td>
													<td width="17%">
														<div class="col-md-11">
															<select class="form-control" id="quotationOfficer"
																name="quotationOfficer" style="width: 100%">
																<option></option>
																<option th:each="user:${allSuperiorMen}"
																	th:text="${user.empLogin.name}"></option>
															</select>
														</div>

													</td>
												</tr>
												<tr class="odd gradeX">
													<td width="8%" align="center"
														style="vertical-align: middle">经办部门</td>
													<td width="17%">
														<div class="col-md-11">
															<input class="form-control" type="text" readonly="readonly"
																id="operatDepartment" name="operatDepartment"
																th:value="${superior}" />
														</div>
													</td>
													<td width="8%" align="center"
														style="vertical-align: middle">经办人</td>
													<td width="17%">
														<div class="col-md-11">
															<input class="form-control" type="text" id="operator" readonly="readonly"
																name="operator" th:value="${userName}" />
														</div>
													</td>
													<td width="8%" align="center"
														style="vertical-align: middle">经办日期</td>
													<td width="17%">
														<div class="col-md-11">
															<input class="form-control" type="date" id="operatDate"
																name="operatDate"
																th:value="${#dates.format(operatDate,'yyyy-MM-dd')}" />
														</div>
													</td>
												</tr>
												<tr class="odd gradeX">
													<td align="center" style="vertical-align: middle">备注</td>
													<td colspan="7">
														<div class="col-md-11">
															<textarea class="form-control" style="width: 100%"
																id="memo" name="memo" rows="3"></textarea>
														</div>
														<div class="col-md-1">
															<span style="color: #F00"></span>
														</div>
													</td>
												</tr>
											</tbody>
										</table>
									</form>
									<form id="form-audit-submit">
										<table class="table table-bordered" id="auditTable"
											style="display: none">
											<tbody>

												<tr class="odd gradeX">
													<td class="center">审批类型</td>
													<td width="17%"><select class="form-control"
														id="auditorNumber" name="auditorNumber">
															<option value='1'>一级审批</option>
															<option value='2'>二级审批</option>
															<option value='3'>三级审批</option>
															<option value='4'>四级审批</option>
													</select></td>
													<td colspan="4"></td>
												</tr>
												<tr class="odd gradeX">
													<td width="8%" class="center">一级审批人</td>
													<td width="17%"><input readonly="readonly"
														class="form-control" type="text" id="ai1" name="ai1"
														datatype="*,*1-100,t" nullmsg="请指定审批人" /></td>
													<td><button id="1" type="button"
															style="margin-left: 20px;"
															class="btn btn-sm btn-info  btn-find-auditor ">添加</button></td>
													<td colspan="3"></td>
												</tr>
												<tr id="row2" class="odd gradeX  hide row-auditor">
													<td width="8%" class="center">二级审批人</td>
													<td width="17%"><input readonly="readonly"
														class="form-control" type="text" id="ai2" name="ai2"
														datatype="*,*1-100,t" nullmsg="请指定审批人" /></td>
													<td><button id="2" type="button"
															style="margin-left: 20px;"
															class="btn btn-sm btn-info  btn-find-auditor ">添加</button></td>
													<td colspan="3"></td>
												</tr>
												<tr id="row3" class="odd gradeX  hide row-auditor">
													<td width="8%" class="center">三级审批人</td>
													<td width="17%"><input readonly="readonly"
														class="form-control" type="text" id="ai3" name="ai3"
														datatype="*,*1-100,t" nullmsg="请指定审批人" /></td>
													<td><button id="3" type="button"
															style="margin-left: 20px;"
															class="btn btn-sm btn-info  btn-find-auditor ">添加</button></td>
													<td colspan="3"></td>
												</tr>
												<tr id="row4" class="odd gradeX  hide row-auditor">
													<td width="8%" class="center">四级审批人</td>
													<td width="17%"><input readonly="readonly"
														class="form-control" type="text" id="ai4" name="ai4"
														datatype="*,*1-100,t" nullmsg="请指定审批人" /></td>
													<td><button id="4" type="button"
															style="margin-left: 20px;"
															class="btn btn-sm btn-info  btn-find-auditor ">添加</button></td>
													<td colspan="3"></td>
												</tr>
											</tbody>
										</table>
										<input type="hidden" name="auditor1" id="auditor1" /> <input
											type="hidden" name="auditor2" id="auditor2" /> <input
											type="hidden" name="auditor3" id="auditor3" /> <input
											type="hidden" name="auditor4" id="auditor4" /> <input
											type="hidden" name="auditor5" id="auditor5" />
									</form>

									<div>
										<a type="button" class="btn btn-default pull-right"
											href="javascript:history.go(-1)">返回</a>
										<!-- <button type="button" class="btn btn-primary pull-right app-btn-submit" id="app-btn-submit" style="display:none">合同审批</button>
									<button type="button" class="btn btn-primary pull-right submitBtn" id="submitBtn" style="display:block">提交</button> -->
										<button type="button"
											class="btn btn-primary pull-right saveContractBtn"
											id="saveContractBtn" style="display: block">保存</button>
										<button type="button" class="btn btn-info pull-right btnList">附件下载</button>
										<button type="button"
											class="btn btn-info pull-right btnUpload">附件上传</button>
									</div>
								</div>

								<div id="tab2" class="tab-pane">
									<div class="box-body">
										<div class="form-inline">
											<div class="form-group">
												<h4>
													<strong>备件</strong>
												</h4>
											</div>
											<div class="btn-group pull-right">
											<button type="button"
													class="btn btn-info clearPrice" >清空含税单价总价</button>
											<button type="button"
													class="btn btn-info insert-re" >插入</button>
											<button type="button"
													class="btn btn-info move" data-toggle="up">上移</button>
												<button type="button"
													class="btn btn-info move" data-toggle="down">下移</button>
												<button type="button"
													class="btn btn-info importReplacementList">导入备件报价清单</button>
												<button type="button" class="btn btn-info batchToHost">批量关联主机合同</button>
												<button type="button" class="btn btn-info addReplacementBtn">新增</button>
												<button type="button"
													class="btn btn-info editReplacementBtn">编辑</button>
												<button type="button" class="btn btn-info delReplacementBtn">删除</button>
											</div>
										</div>
									</div>
									<table width="100%"
										class="mytable dataTable table-bordered text-center table-striped table-hover"
										id="resultReplacementTable">
										<thead>
											<tr>
												<th class="center" width="3%">序号</th>
												<th class="center" width="3%"><input type="checkbox"
													id="checkAllReplacement" /></th>
												<th class="center" width="8%">关联合同号</th>
												<th class="center" width="8%">备件名称</th>
												<th class="center" width="7%">规格型号</th>
												<th class="center" width="8%">材料</th>
												<th class="center" width="5%">单位</th>
												<th class="center" width="8%">数量</th>
												<th class="center" width="7%">含税单价</th>
												<th class="center" width="7%">含税总价</th>
												<th class="center" width="7%">物料编码</th>
												<th class="center" width="7%">使用分厂</th>
												<th class="center" width="7%">客户物料名称</th>
												<th class="center" width="7%">客户物料规格</th>
												<th class="center" width="8%">备注</th>
											</tr>
										</thead>
										<tbody>
										</tbody>
									</table>

									<div>
										<a type="button" class="btn btn-default pull-right"
											href="javascript:history.go(-1)">返回</a>
										<button type="button"
											class="btn btn-primary pull-right saveContractBtn">保存</button>
									</div>
								</div>

							</div>
						</div>


					</div>
				</div>
			</div>
		</section>

		<!--新建/编辑备件弹窗-->
		<div class="modal" id="editReplacementModal">
			<div class="modal-dialog" role="dialog" style="width: 80%">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="close" data-dismiss="modal"
							aria-label="Close">
							<span aria-hidden="true">&times;</span>
						</button>
						<h4 class="modal-title">
							<strong>备件信息</strong>
						</h4>
					</div>
					<div class="modal-body">
						<form id="editOneReplacementAtrrForm">
							<input type="hidden" name="replacementId" id="replacementId" />
							<input type="hidden" name="indexOrder" id="indexOrder" />
							<input type="hidden" id="replacementcreateTime"
								name="replacementcreateTime" />
								<table class="table table-bordered">
								<tbody>
									<tr class="odd gradeX">
										<td width="10%" align="center" style="vertical-align: middle">备件名称</td>
										<td width="25%">
											<div class="col-md-11">
												<input class="form-control" type="text" id="deviceName"
													name="deviceName" datatype="*,*1-100,t" nullmsg="请输入备件名称" />
											</div>
											<div class="col-md-1">
												<span style="color: #F00">*</span>
											</div>
										</td>
										<td width="10%" align="center" style="vertical-align: middle">规格型号</td>
										<td width="25%">
											<div class="col-md-11">
												<input class="form-control" type="text" id="type"
													name="type" datatype="*,*1-100,t" nullmsg="请输入规格型号" />
											</div>
											<div class="col-md-1">
												<span style="color: #F00">*</span>
											</div>
										</td>
										<td width="10%" align="center" style="vertical-align: middle">物料编码</td>
										<td width="25%">
											<div class="col-md-11">
												<input class="form-control" type="text" id="materialCoding"
													name="materialCoding" />
											</div>
										</td>
									</tr>
									<tr class="odd gradeX">
										<td width="10%" align="center" style="vertical-align: middle">单
											位</td>
										<td width="20%">
											<div class="col-md-11">
												<select class="form-control" id="unit" name="unit"
													datatype="*,*1-100,t" nullmsg="请选择单位">
													<option>台</option>
													<option>个</option>
													<option>根</option>
													<option>片</option>
													<option>件</option>
													<option>套</option>
													<option>付</option>
												</select>
											</div>
											<div class="col-md-1">
												<span style="color: #F00">*</span>
											</div>
										</td>
										<td width="10%" align="center" style="vertical-align: middle">数
											量</td>
										<td width="25%">
											<div class="col-md-11">
												<input class="form-control" type="text" id="amount"
													name="amount" onkeyup="clearNoNum(this)" datatype="*,d"
													nullmsg="请输入数量" errormsg="请输入整数" />
											</div>
											<div class="col-md-1">
												<span style="color: #F00">*</span>
											</div>
										</td>
										<td width="10%" align="center" style="vertical-align: middle">单价含税（元）</td>
										<td width="25%">
											<div class="col-md-11">
													<div class="has-feedback">
														<input class="form-control" type="text" id="price"
													name="price" onkeyup="clearNoNum(this)" datatype="n" />
													<!--删除按钮-->
													<a  
														class=" btn form-control-feedback" 
														style="pointer-events: auto;display: none" id="clear-price" data-close="price">
														<i data-close="price" class="fa fa-remove" ></i>
														</a>
												</div>
											</div>
										</td>
									</tr>
									<tr>
										<td width="10%" align="center" style="vertical-align: middle">总价含税(元)</td>
										<td width="25%">
											<div class="col-md-11">
												<input class="form-control" readonly="readonly" type="text"
													id="totalPrice" name="totalPrice"
													onkeyup="clearNoNum(this)" datatype="n" />
											</div>
										</td>

										<td width="10%" align="center" style="vertical-align: middle">关联合同号</td>
										<td width="20%">
											<div class="col-md-11">
												<input class="form-control" type="text" id="oneSupplierCode"
													name="oneSupplierCode" 
													readonly="readonly"  />
											</div>
										</td>
										
										<td width="10%" align="center" style="vertical-align: middle">材
											料</td>
										<td width="25%">
											<div class="col-md-11">
												<input class="form-control" type="text" id="material"
													name="material" />
											</div>
										</td>
									</tr>
									<tr>
										<td width="10%" align="center" style="vertical-align: middle">使用分厂</td>
										<td width="25%">
											<div class="col-md-11">
												<input class="form-control"  type="text"
													id="branchFactory" name="branchFactory"
													 />
											</div>
										</td>

										<td width="10%" align="center" style="vertical-align: middle">客户物料名称</td>
										<td width="20%">
											<div class="col-md-11">
												<input class="form-control" type="text" id="cusMaterielName"
													name="cusMaterielName" 
													 />
											</div>
										</td>
										
										<td width="10%" align="center" style="vertical-align: middle">客户物料规格</td>
										<td width="25%">
											<div class="col-md-11">
												<input class="form-control" type="text" id="cusMaterielSpec"
													name="cusMaterielSpec" />
											</div>
										</td>
									</tr>
									<tr>
										<td align="center" style="vertical-align: middle">备注</td>
										<td colspan="7">
											<div class="col-md-11">
												<textarea class="form-control" style="width: 100%"
													id="memo1" name="memo1" rows="2"></textarea>
											</div>
										</td>
									</tr>
								</tbody>
							</table>
					
					
					
						</form>
						<form id="editMoreReplacementAtrrForm">
							<input type="hidden" name="ids" id="ids" />
							<table class="table table-bordered">
								<tbody>
									<tr class="odd gradeX">
										<td width="10%" align="center" style="vertical-align: middle">关联合同号</td>
										<td width="25%">
											<div class="col-md-11">
												<input class="form-control" type="text"
													id="moreSupplierCode" name="moreSupplierCode"
													datatype="*,*1-100,t" readonly="readonly"
													nullmsg="请选择需要关联的合同号" />
											</div>
											<div class="col-md-1">
												<span style="color: #F00">*</span>
											</div>
										</td>
										<td colspan="4"></td>
									</tr>
								</tbody>
							</table>
						</form>
						<div class="form-inline">
							<div class="input-group">
								<input type="text" class="form-control" id="keywordContract"
									placeholder="Search..." /> <input type="hidden"
									name="selectContractId" id="selectContractId" /> <span
									class="input-group-btn">
									<button type="button" id="search-btn"
										class="btn btn-info searchContractBtn">查询</button>
									<button type="button" id="reset-btn"
										class="btn btn-info resetContractBtn">撤消</button>
								</span>
							</div>
						</div>
						<table id="resultContractTable"
							class="mytable dataTable table-bordered text-center table-striped table-hover"
							cellspacing="0" width="100%" align="center">
							<thead>
								<tr>
									<th width="6%">序号</th>
									<th width="6%">操作</th>
									<th width="13%">合同号</th>
									<th width="10%">所属板块</th>
									<th width="10%">总价(元)</th>
									<th width="10%">签订日期</th>
									<th width="20%">项目名称</th>
									<th width="15%">订货单位</th>
									<th width="10%">订货片区</th>
								</tr>
							</thead>
							<tbody>
							</tbody>
						</table>
						<div class="modal-footer">
							<button type="button" class="btn btn-primary saveReplacementBtn">保存</button>
							<button type="button" class="btn btn-default"
								data-dismiss="modal">返回</button>
						</div>
					</div>
				</div>
			</div>
		</div>

		<!--引入用户信息弹窗-->
		<div class="modal" id="modal-find-auditor">
			<div class="modal-dialog" role="dialog" style="width: 60%">
				<form id="form-find-user">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal"
								aria-label="Close">
								<span aria-hidden="true">&times;</span>
							</button>
							<h4 class="modal-title">
								<strong>用户查找</strong>
							</h4>
						</div>
						<div class="modal-body">
							<div class="form-horizontal">
								<div class="box-body">
									<div class="form-inline">
										<div class="input-group">
											<input type="text" class="form-control" id="search"
												placeholder="Search..." /> <span class="input-group-btn">
												<button type="button" id="btn-search"
													class="btn btn-info app-btn-search">查询</button>
												<button type="button" id="btn-reset"
													class="btn btn-info app-btn-reset">撤消</button>
											</span>
										</div>
									</div>
								</div>
								<div class="box box-body">
									<table id="table-user"
										class="mytable dataTable table-bordered text-center table-striped table-hover"
										cellspacing="0" width="100%" align="center">
										<thead>
											<tr>
												<th width="10%">序号</th>
												<th width="20%">姓名</th>
												<th width="20%">性别</th>
												<th width="20%">职务</th>
												<th width="20%">销售区域</th>
												<th width="10%">选择</th>
											</tr>
										</thead>
										<tbody>

										</tbody>
									</table>
								</div>
							</div>
						</div>
						<div class="modal-footer">
							<button type="button" class="btn btn-info" id="btn-reference">引入</button>
							<button type="button"
								class="btn btn-default app-find-user-return"
								data-dismiss="modal">返回</button>
						</div>
					</div>
				</form>
			</div>
		</div>
		<!--引入用户信息弹窗结束-->

		<!--引入客户开票信息弹窗-->
		<div class="modal" id="modal-find-CustomerPayInfo">
			<div class="modal-dialog" role="dialog" style="width: 60%">
				<form id="form-find-CustomerPay">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal"
								aria-label="Close">
								<span aria-hidden="true">&times;</span>
							</button>
							<h4 class="modal-title">
								<strong>开票信息查找</strong>
							</h4>
						</div>
						<div class="modal-body">
							<div class="form-horizontal">
								<!-- <div class="box-body">
									<div class="form-inline">
										<div class="input-group">
											<input type="text" class="form-control" id="search1"
												   placeholder="Search..." /> <span class="input-group-btn">
													<button type="button" id="btn-search1"
															class="btn btn-info app-btn-search">查询</button>
													<button type="button" id="btn-reset1"
															class="btn btn-info app-btn-reset">撤消</button>
												</span>
										</div>
									</div>
								</div> -->
								<div class="box box-body">
									<table id="table-CustomerPay"
										class="mytable dataTable table-bordered text-center table-striped table-hover"
										cellspacing="0" width="100%" align="center">
										<thead>
											<tr>
												<th width="6%">序号</th>
												<th width="5%">操作</th>
												<th width="10%">客户编号</th>
												<th width="10%">联系电话</th>
												<th width="10%">邮编</th>
												<th width="14%">开票地址</th>
												<th width="12%">开票银行</th>
												<th width="10%">税号</th>
												<th width="10%">银行账号</th>
												<th width="10%">是否主机默认</th>
												<th width="10%">是否备件默认</th>
											</tr>
										</thead>
										<tbody>
										</tbody>
									</table>
								</div>
							</div>
						</div>
						<div class="modal-footer">
							<button type="button" class="btn btn-info" id="btn-reference1">引入</button>
							<button type="button"
								class="btn btn-default app-find-user-return"
								data-dismiss="modal">返回</button>
						</div>
					</div>
				</form>
			</div>
		</div>
		<!--引入邮寄单位信息弹窗-->
		<div class="modal" id="post-unit-modal">
			<div class="modal-dialog" role="dialog" style="width: 60%">
				<form id="post-unit-form">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal"
								aria-label="Close">
								<span aria-hidden="true">&times;</span>
							</button>
							<h4 class="modal-title">
								<strong>邮寄单位信息查找</strong>
							</h4>
						</div>
						<div class="modal-body">
							<div class="form-horizontal">
								<!-- <div class="box-body">
									<div class="form-inline">
										<div class="input-group">
											<input type="text" class="form-control" id="search1"
												   placeholder="Search..." /> <span class="input-group-btn">
													<button type="button" id="btn-search1"
															class="btn btn-info app-btn-search">查询</button>
													<button type="button" id="btn-reset1"
															class="btn btn-info app-btn-reset">撤消</button>
												</span>
										</div>
									</div>
								</div> -->
								<div class="box box-body">
									<table id="post-unit-table"
										class="mytable dataTable table-bordered text-center table-striped table-hover"
										cellspacing="0" width="100%" align="center">
										<thead>
											<tr>
												<th width="5%">序号</th>
												<th width="5%">操作</th>
												<th width="15%">邮寄单位</th>
												<th width="10%">邮寄代表</th>
												<th width="10%">邮寄电话</th>
												<th width="10%">邮寄邮编</th>
												<th width="15%">邮寄地址</th>
												<th width="15%">是否主机默认</th>
												<th width="15%">是否备件默认</th>
											</tr>
										</thead>
										<tbody>
										</tbody>
									</table>
								</div>
							</div>
						</div>
						<div class="modal-footer">
							<button type="button" class="btn btn-info" id="post-unit-addBtn">引入</button>
							<button type="button"
								class="btn btn-default app-find-user-return"
								data-dismiss="modal">返回</button>
						</div>
					</div>
				</form>
			</div>
		</div>
		<!--引入客户开票信息弹窗结束-->
		<!-- 新增客户信息弹窗 -->
		<div class="modal" id="newCustomer">
			<div class="modal-dialog" role="dialog">
				<form id="son_customer">
					<input class="form-control" type="hidden" id="id_son" name="id_zhi" />
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal"
								aria-label="Close">
								<span aria-hidden="true">&times;</span>
							</button>
							<h4 class="modal-title">
								<strong>新增客户信息</strong>
							</h4>
						</div>
						<div class="modal-body">
							<div class="form-horizontal">
								<div class="form-group">
									<label class="col-sm-2 control-label">客户编号</label>
									<div class="col-sm-10">
										<div class="col-md-11">
											<!-- <input class="form-control" type="text" name="identification_son" id="identification_son"  /> -->
											<input class="form-control" type="text" name="customerCode"
												id="customerCode" readonly="readonly"
												th:value="${customerCode}" />
										</div>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">单位名称</label>
									<div class="col-sm-10">
										<div class="col-md-11">
											<input class="form-control" type="text"
												name="identification_son" id="identification_son"
												datatype="*,*1-100" nullmsg="请输入单位名称" />
										</div>
										<div class="col-md-1">
											<span style="color: #F00">*</span>
										</div>
									</div>

								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">所属片区</label>
									<div class="col-sm-4">
										<div class="col-md-11">
											<!-- <input class="form-control" type="text" name="identification_son" id="identification_son"  /> -->
											<select class="form-control" id="saleArea" name="saleArea">
												<option th:each="saleArea:${saleAreas}"
													th:value="${saleArea.id}"
													th:text="${saleArea.superiorArea}"></option>
											</select>
										</div>
									</div>
									<label class="col-sm-2 control-label">行业</label>
									<div class="col-sm-4">
										<div class="col-md-11">
											<select class="form-control" id="business" name="business">
												<option th:each="business:${businesses}"
													th:text="${business.title}" th:value="${business.value}"></option>
											</select>
										</div>
									</div>
								</div>

								<div class="form-group">
									<label class="col-sm-2 control-label">上级单位</label>
									<div class="col-sm-10">
										<div class="col-md-11">
											<!-- <input class="form-control" type="text" name="identification_son" id="identification_son"  /> -->
											<select class="form-control" id="superior" name="superior">
												<option></option>
												<option th:each="customer:${customers}"
													th:text="${customer.customerName}"></option>
											</select>
										</div>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">单位地址</label>
									<div class="col-sm-10">
										<div class="col-md-11">
											<input class="form-control" type="text" id="address"
												name="address" />
										</div>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">纳税人识别号</label>
									<div class="col-sm-4">
										<div class="col-md-11">
											<input class="form-control" type="text"
												name="identifications_son" id="identifications_son" />
										</div>
									</div>
									<label class="col-sm-2 control-label">联系电话</label>
									<div class="col-sm-4">
										<div class="col-md-11">
											<input class="form-control" type="text"
												name="invoicePhone_son" id="invoicePhone_son" />
										</div>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">邮编</label>
									<div class="col-sm-4">
										<div class="col-md-11">
											<input class="form-control" type="text" name="zipCode_son"
												id="zipCode_son" />
										</div>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">开票地址</label>
									<div class="col-sm-10">
										<div class="col-md-11">
											<input class="form-control" type="text"
												name="invoiceAddress_son" id="invoiceAddress_son" />
										</div>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">开票银行</label>
									<div class="col-sm-4">
										<div class="col-md-11">
											<input class="form-control" type="text"
												name="invoiceBank_son" id="invoiceBank_son" />
										</div>
									</div>
									<label class="col-sm-2 control-label">银行账号</label>
									<div class="col-sm-4">
										<div class="col-md-11">
											<input class="form-control" type="text"
												name="bankAccount_son" id="bankAccount_son" />
										</div>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">税号</label>
									<div class="col-sm-4">
										<div class="col-md-11">
											<input class="form-control" type="text" name="taxNumber_son"
												id="taxNumber_son" />
										</div>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">邮寄单位</label>
									<div class="col-sm-10">
										<div class="col-md-11">
											<input class="form-control" type="text" name="postUnit_son"
												id="postUnit_son" />
										</div>
									</div>
								</div>

								<div class="form-group">
									<label class="col-sm-2 control-label">邮寄代表</label>
									<div class="col-sm-4">
										<div class="col-md-11">
											<input class="form-control" type="text"
												name="postDelegate_son" id="postDelegate_son" />
										</div>
									</div>
									<label class="col-sm-2 control-label">邮寄电话</label>
									<div class="col-sm-4">
										<div class="col-md-11">
											<input class="form-control" type="text" name="postPhone_son"
												id="postPhone_son" />
										</div>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">邮寄邮编</label>
									<div class="col-sm-4">
										<div class="col-md-11">
											<input class="form-control" type="text" name="postZip_son"
												id="postZip_son" />
										</div>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">邮寄地址</label>
									<div class="col-sm-10">
										<div class="col-md-11">
											<input class="form-control" type="text"
												name="postAddress_son" id="postAddress_son" />
										</div>
									</div>
								</div>
								<div class="form-group">
									<label class="col-sm-2 control-label">备注</label>
									<div class="col-sm-10">
										<div class="col-md-11">
											<textarea class="form-control" type="text"
												id="invoiceMemo_son" name="invoiceMemo_son"></textarea>
										</div>
									</div>
								</div>
							</div>
						</div>
						<div class="modal-footer">
							<button type="button" class="btn btn-info" id="son_save">保存</button>
							<button type="button" class="btn btn-default"
								data-dismiss="modal">返回</button>
						</div>
					</div>
				</form>
			</div>
		</div>
		<!-- 新增客户信息弹窗结束 -->
		
		
		<!-- 引入报价单弹窗开始 -->
		<div class="modal" id="quotation-dialog">
			<div class="modal-dialog" role="dialog" style="width: 60%">
				<form id="form-find-quotation">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal"
									aria-label="Close">
								<span aria-hidden="true">&times;</span>
							</button>
							<h4 class="modal-title">
								<strong>报价单引入</strong>
							</h4>
						</div>
						<div class="modal-body">
							<div class="form-horizontal">
								<div class="box-body">
									<div class="form-inline">
										<div class="input-group">
											<input type="text" class="form-control" id="quotation-search"
												   placeholder="Search..." /> <span class="input-group-btn">
													<button type="button" id="btn-quotationSearch"
															class="btn btn-info app-btn-quotation-search">查询</button>
													<button type="button" id="btn-quotationReset"
															class="btn btn-info app-btn-quotation-reset">撤消</button>
												</span>
										</div>
									</div>
								</div>
								<div class="box box-body">
									<table id="table-quotation"
										   class="mytable dataTable table-bordered text-center table-striped table-hover"
										   cellspacing="0" width="100%" align="center">
										<thead>
										<tr>
											<th width="5%">序号</th>
											<th width="5%">操作</th>
											<th width="10%">项目名称</th>
											<th width="15%">客户名称</th>
											<th width="10%">总价</th>
											<th width="15%">备注</th>
										</tr>
										</thead>
										<tbody>
	
										</tbody>
									</table>
								</div>
							</div>
						</div>
						<div class="modal-footer">
							<button type="button" class="btn btn-info" id="btn-quotation">引入</button>
							<button type="button" class="btn btn-info" id="btn-quotation-select" style="display:none">选择</button>
							<button type="button"
									class="btn btn-default app-find-quotation-return"
									data-dismiss="modal">返回</button>
						</div>
					</div>
				</form>
			</div>
		</div>
		<!--引入报价单弹窗结束-->
		
		<div class="modal" id="adjustmentModal">
			<div class="modal-dialog" role="dialog">
				<form id="son_customer">
					<div class="modal-content">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal"
								aria-label="Close">
								<span aria-hidden="true">&times;</span>
							</button>
							<h4 class="modal-title">
								<strong>调整合同总价</strong>
							</h4>
						</div>
						<div class="modal-body">
							<div class="form-horizontal">
								<div class="form-group">
									<label class="col-sm-2 control-label">合同总价</label>
									<div class="col-sm-4">
										<div class="col-md-11">
											<!-- <input class="form-control" type="text" name="identification_son" id="identification_son"  /> -->
											<input class="form-control" type="text" name="oldtotalSum" id="oldtotalSum" readonly="readonly" />
										</div>
									</div>
									<label class="col-sm-2 control-label">百分比(%)</label>
									<div class="col-sm-4">
										<div class="col-md-11">
                                    		<input class="form-control" type="text" id="ratio" name="ratio" datatype="*,*1-11,t" onkeyup="clearNoNum(this)"/>
                                   		</div>
                                    </div>
								</div>
								<!-- <div class="form-group">
									
								</div> -->
							</div>
						</div>
						<div class="modal-footer">
							<button type="button" class="btn btn-info" id="up">上涨</button>
							<button type="button" class="btn btn-info" id="down">下浮</button>
							<button type="button" class="btn btn-default"
								data-dismiss="modal">返回</button>
						</div>
					</div>
				</form>
			</div>
		</div>

		<script th:src="@{/contract/contract-replacement.js}"></script>
		<script th:src="@{/contract/contractindex.js}"></script>
		<script th:src="@{/contract/detail-relevance.js}"></script>
		<script th:src="@{/contract/contract-audit-submit.js}"></script>
		<script th:inline="javascript">
			/*<![CDATA[*/

			var contractId = "";
			var contractCode = "";
			var contractType = "";

			/*]]>*/
		</script>
	</div>


</body>
</html>